package com.scrx.ymg.dao.supermarket;

import java.util.List;
import java.util.Map;

import org.springframework.web.multipart.MultipartFile;

import com.scrx.ymg.entity.AgentDrawings;
import com.scrx.ymg.entity.AgentMoney;
import com.scrx.ymg.entity.AgentSuperMarketSet;
import com.scrx.ymg.entity.BankAccount;
import com.scrx.ymg.entity.DirectMoney;
import com.scrx.ymg.entity.GoodsType;
import com.scrx.ymg.entity.HeadMoney;
import com.scrx.ymg.entity.OtherInfo;
import com.scrx.ymg.entity.SuperMarketEntrepot;
import com.scrx.ymg.entity.SuperMarketInfo;
import com.scrx.ymg.entity.SupermarketDrawings;
import com.scrx.ymg.entity.SupermarketMoney;
import com.scrx.ymg.entity.SupermarketSet;

public interface ISuperMarketDao {
	
	/**
	 * 根据超市id查询超市所有商品
	 */
	public List<SuperMarketEntrepot> findAllbyID(String superinfoID);
	
	/**
	 * 登陆查询
	 * @param username
	 * @param password
	 * @return
	 */
	public SuperMarketInfo findone(String username,String password);
	
	/**
	 * 查询商品分类
	 * @return
	 */
	public List<GoodsType> findAll();
	
	/**
	 * 查询2级商品分类
	 * @return
	 */
	public List<GoodsType> findOne(String typeID);
	
	/**
	 * 根据经纬度查询超市
	 * @param maxlon 最大经度
	 * @param maxlat 最大纬度
	 * @param minlon 最小经度
	 * @param minlat 最小纬度
	 * @return 超市集合
	 */
	public List<SuperMarketInfo> findSuperListBylatlon(double maxlon,double maxlat,double minlon,double minlat);
	
	/**
	 * 根据id拿到超市对象
	 * @param id
	 * @return
	 */
	public SuperMarketInfo findByID(Integer id);
	
	/**
	 * 根据id拿到超市营业额对象
	 * @param id
	 * @return
	 */
	public SupermarketMoney findSupermarketMoneyByID(Integer id);
	
	/**
	 * 新建超市
	 * @param superInfo
	 * @return
	 */
	public String save(SuperMarketInfo superInfo);
	
	/**
	 * 更新超市信息
	 * @param superInfo
	 * @return
	 */
	public String update(SuperMarketInfo superInfo);
    
	/**
	 * 创建超市
	 * @param superInfo
	 * @param liveAction
	 * @param liveActionPath
	 * @param license
	 * @param licensePath
	 * @param deliver
	 * @param deliverPath
	 * @param card
	 * @param cardPath
	 * @return
	 */
	public String createSuperMarket(SuperMarketInfo superInfo,SupermarketSet set, MultipartFile liveAction, String liveActionPath,
			MultipartFile license, String licensePath, MultipartFile deliver, String deliverPath, MultipartFile card,
			String cardPath);
	/**
	 * 修改超市信息,重置超市信息
	 * @param superInfo
	 * @param set
	 * @param liveAction
	 * @param liveActionPath
	 * @param license
	 * @param licensePath
	 * @param deliver
	 * @param deliverPath
	 * @param card
	 * @param cardPath
	 * @return
	 */
	public String updateSuperMarket(SuperMarketInfo superInfo,SupermarketSet set,BankAccount  bank, MultipartFile liveAction, String liveActionPath,
			MultipartFile license, String licensePath, MultipartFile deliver, String deliverPath, MultipartFile card,
			String cardPath);
    
	/**
	 * 代理商查询超市开店设置
	 * @param agentId
	 * @param pageNum
	 * @param pageCount
	 * @return
	 */
	public Map<Object, Object> getSuperMarketSetinfo(AgentSuperMarketSet set, int pageNum, int pageCount);
    
	/**
	 * 得到超市营业额
	 * @param superId
	 * @return
	 */
	public SupermarketMoney getSupermarketMoneyInfo(int superId);
    /**
     * 创建银行账户
     * @param bankAccount
     * @return
     */
	public String createBankAccountInfo(BankAccount bankAccount);
    
	/**
	 * 查询超市银行账户
	 * @param superId
	 * @return
	 */
	public BankAccount isNullBankAccountInfo(int superId);
    
	/**
	 * 超市提现并生成提现记录
	 * @param money
	 * @param drawings
	 * @return
	 */
	public String updateMoneyAndCreateLog(SupermarketMoney money, SupermarketDrawings drawings);
    
	 /**
     * 查询超市提现记录
     * @param drawing
     * @param pageNum
     * @param pageCount
     * @return
     */
	public Map<Object, Object> getSupermarketDrawings(SupermarketDrawings drawing, int pageNum, int pageCount);

	/**
     * 查询超市
     * @param info
     * @param pageNum
     * @param pageCount
     * @return
     */
	public Map<Object, Object> getAllSuperMarketInfo(SuperMarketInfo info, int pageNum, int pageCount);
    
	/**
	 * 查询代理商银行账户
	 * @param agentId
	 * @return
	 */
	public BankAccount isNullBankAccountInfoAgent(int agentId);
	

    
	/**
	 *  查询异业银行账户
	 * @param otherId
	 * @return
	 */
	public BankAccount isNullBankAccountInfoOther(int otherId);
	
	/**
	 *  查询直营银行账户
	 * @param otherId
	 * @return
	 */
	public BankAccount isNullBankAccountInfoDirect(int directId);
	/**
	 *  代理商提现并生成提现记录
	 * @param agentMoney
	 * @param drawings
	 * @return
	 */
	public String updateMoneyAndCreateLog(Object object, AgentDrawings drawings);
    
	/**
	 * 查询代理商提现记录
	 * @param drawing
	 * @param pageNum
	 * @param pageCount
	 * @return
	 */
	public Map<Object, Object> getAgentDrawings(AgentDrawings drawing, int pageNum, int pageCount);
    
	
	/**
	 * 删除超市
	 * @param info
	 * @return
	 */
	public String deleteSuperMarketInfo(SuperMarketInfo info);
    
	
	/**
	 * 查询冻结,恢复超市
	 * @param info
	 * @param pageNum
	 * @param pageCount
	 * @return
	 */
	public Map<Object, Object> getSuperMarketInfoByStatus(SuperMarketInfo info, int pageNum, int pageCount);
	
    /**
     * 根据超市名称查询超市
     * @param name
     * @return
     */
    public SuperMarketInfo getsuperMarketInfoBySuperName(String name);
    
    /**
     * 新建超市账户更新超市状态
     * @param oldInfo
     * @param money
     * @return
     */
	public String updateInfoAndSaveMoney(SuperMarketInfo oldInfo, SupermarketMoney money,List<SuperMarketEntrepot> list);
    
	/**
	 * 提现更新金额
	 * @param directMoney
	 * @param drawings
	 * @param headMoney
	 * @return
	 */
	public String updateMoney(Object obj, AgentDrawings drawings, HeadMoney headMoney);

	/**
	 * 根据提现订单Id查询订单
	 * @param drawingId
	 * @return
	 */
	public AgentDrawings getAgentDrawings(int drawingId);

	
    
    
}
